package com.moyu.blog.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


@Configuration
public class WebMVCConfig implements WebMvcConfigurer {

    public void addCorsMappings(CorsRegistry registry){
        //允许跨域访问，8080端口访问自己(8888)
        registry.addMapping("/**").allowedOrigins("https://localhost:8080");
    }
}
